// src/api/post.js
import axios from 'axios'

const API_URL = "http://localhost:8080/app/posts"  // 对应你的 PostController

/**
 * 新增主楼帖子
 * @param postInfo { hotelId, orderId?, userId, content, rating? }
 */
export const addPost = (postInfo) => {
    return axios.post(`${API_URL}`, postInfo)
}

/**
 * 获取某条帖子详情 + 楼中楼
 * @param postId 帖子 ID
 */
export const getPostDetail = (postId) => {
    return axios.get(`${API_URL}/${postId}`)
}

/**
 * 获取所有帖子列表
 */
export const getAllPosts = () => {
    return axios.get(`${API_URL}`)
}
